package com.gxa.controller.xxh.FinancialManagement;

import com.gxa.common.R;
import com.gxa.service.FinancialReportService;
import io.swagger.annotations.*;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@Api(value = "财务报表功能",tags = "财务报表功能API")
@RequestMapping(value = "/FinancialManagement/Report")
@RequiresRoles(value = {"超级管理员","院长","主任"},logical = Logical.OR)
public class FinancialReportController {
    @Autowired
    FinancialReportService financialReportService;

    @RequestMapping(value = "/financialStatement",method = RequestMethod.GET)
    @ApiOperation(value = "财务报表接口",notes = "财务报表",httpMethod = "GET",response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R financialStatement(){

        return financialReportService.financialStatement();
    }

    @RequestMapping(value = "/yearlyEarnings",method = RequestMethod.GET)
    @ApiOperation(value = "年度盈利报告接口",notes = "年度盈利报告",httpMethod = "GET",response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R yearlyEarnings(){

        return financialReportService.yearlyEarnings();
    }

    @RequestMapping(value = "/financialDetail",method = RequestMethod.GET)
    @ApiOperation(value = "详细收支报告接口",notes = "详细收支报告",httpMethod = "GET",response = R.class)
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R financialDetail(){

        return financialReportService.financialDetail();
    }
}